home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 2 / Gold Medal Software Volume 2 (Gold Medal) (1994).iso / prog / asm_n_z.arj / NEWINIT.ASM next >
Assembly Source File  |  1987-05-05  |  18KB  |  574 lines

  1. title newinit.asm
  2. comment |--------------------------------------------------------------
  3. In text modes the active page can be switched between 1-4 (80-col) or
  4.  1-8 (40-col) by pressing ALT and the corresponding # on the TOP ROW. This
  5.  feature can only be used to view the other pages.  Results of all CON I/O
  6.  while paging are unpredictable and messy.
  7. As protection against duplicate installation, INT 15h with AX = X'FF00'
  8.  returns AX = X'ABCD'.
  9. The keypad "5" key will toggle processing.  While paused,  a flashing,
  10.  highlighted "P" will appear in the lower-right corner (not graphics).
  11. If Numlock is on, shift-"5" is required.  If Alt or Ctrl are pressed, nothing
  12.  changes.  Scroll Lock, Caps Lock, and Ins are irrelevant.
  13. This program sets the video mode to 80 col monochrome.
  14. The enhanced keyboard can be toggled on/off with Alt-PrtSc, and a 1/8 sec
  15.  2000 Hz tone will sound when toggled on.  (The PrtSc modification cannot
  16.  be turned off.)
  17. NOTE: If both  shift keys are depressed at installation time, the
  18.  installation will be cancelled, with errorlevel set to X'AB'.
  19. ------------------------------------------------------------------------|
  20. bios_data    segment at 0040h
  21.     org    17h
  22. kb_flag    db    ?    ; keyboard status byte
  23. kb_flag_1    db    ?
  24.  
  25.     org    49h
  26. v_mode    db    ?    ; BIOS video mode
  27. v_width    db    ?    ; BIOS screen width
  28.  
  29.     org    62h
  30. v_page    db    ?    ; BIOS video page
  31. mystery_w    dw    ?    ; word used by pause routine
  32. mystery_b    db    ?    ; byte used by pause routine
  33. bios_data ends
  34.  
  35. cseg    segment
  36.     assume    cs:cseg
  37.     org    80h
  38. parm_cnt    db    ?    ; parameter count
  39. parm_data    db    ?    ; start of parameter data space
  40.     org    100h    ; .COM file
  41.  
  42. begin:    jmp    init_vectors    ; initialize and attach to DOS
  43.  
  44. ; addresses of video and keyboard I/O ROM routines
  45. prtsc    dd    0    ; INT 5
  46. kybd    dd    0    ; INT 9
  47. cass    dd    0    ; INT 15h
  48. kybd_io    dd    0    ; INT 16h
  49.  
  50. ; constants and segments
  51. bios_dat    dw    40h    ; bios_data segment
  52. mono_seg    dw    0b000h    ; segment of MGA
  53. color_seg    dw    0b800h    ; segment of CGA
  54. datatbl    db    2,3,0,1,6,4,5    ; scan-code to video mode data
  55. indicator equ "P"+256*10001111b    ; an highlighted, flashing "P"
  56. row equ 24            ; position of indicator for mono moniter
  57. col equ 79
  58. mono_point    equ 2*((row*80)+col)    ; offset in mono segment
  59.  
  60. ; variable data
  61. vdata    db    0    ; current video mode or page
  62. code_seg    dw    0    ; CS of resident routines
  63. graph_bit    db    0    ; flag to signal graphics mode
  64. toggle    db    1    ; enables/disables enhanced keyboard
  65.  
  66. prtsc_int:    sti        ; enable interrupts
  67.     push    ax    ; save regs
  68.     push    dx
  69.     mov    ah,2    ; read printer status
  70.     xor    dx,dx    ; zero DX - LPT1
  71.     int    17h    ; printer I/O
  72.     xor    ah,30h    ; check for OFFLINE
  73.     jnz    chk_shft    ; skip beep, prepare for exit
  74.     pop    dx
  75. no_dump:    pop    ax
  76.     iret
  77. chk_shft:    pop    dx
  78.     push    ds
  79.     mov    ds,bios_dat    ; set DS = X'40'
  80.     assume    ds:bios_data
  81.     test    kb_flag,00000010b    ; check for LEFT shift key
  82.     pop    ds    ; restore regs
  83.     jz    no_dump    ; skip screen dump if no LEFT shift
  84.     pop    ax
  85.     jmp    prtsc    ; print screen routine
  86.  
  87. calculate:    assume    ds:bios_data
  88.     xor    ax,ax    ; zero AX
  89.     xor    cx,cx    ; likewise
  90.     mov    al,v_width    ; AX = 00 width
  91.     mov    cl,v_page    ; save for later multiply
  92.     mov    bx,25    ; calculate offset into page
  93.     mul    bl
  94.     dec    ax    ; = (25*width)-1
  95.     shl    ax,1    ; MUL AX,2 - skip attribute bytes
  96.     mov    bx,ax    ; save in BX
  97.     mov    ax,2048    ; byte length of 40 column page
  98.     cmp    v_width,40    ; check for 40 column screen
  99.     je    multiply    ; if yes, leave AX alone
  100.     shl    ax,1    ; if no, change to 80 column offset
  101. multiply:    mul    cx    ; multiply by page number
  102.     add    bx,ax    ; sum buffer offset with page offset
  103.     mov    es,color_seg    ; load ES with CGA segment
  104.     assume    es:nothing
  105. skip_cga:    mov    cx,es:[bx]    ; save screen data in CX
  106.     mov word ptr es:[bx],indicator   ; store flashing "P" on screen
  107.  
  108. rejoin:    ; branch made if graphics mode - skip indicator
  109.  
  110.     mov    dx,mystery_w    ; load mystery word
  111.     add    dx,4    ; more mysterious code
  112.     mov    al,mystery_b    ; load mystery byte
  113.     out    dx,al    ; I have no clue what this does
  114.  
  115.     call    reset
  116.     or    kb_flag_1,00001000b    ; turn ctrl-num-lock on
  117.     sti        ; enable interrupts
  118. again:    test    kb_flag_1,00001000b    ; check if ctrl-num-lock on
  119.     jnz    again    ; if on, check again
  120.  
  121.     cli        ; disable interrupts (play it safe)
  122.     test    graph_bit,1    ; check if graphics mode
  123.     mov    graph_bit,0    ; reset graphics flag
  124.     jnz    skip_mov    ; skip restoration of screen data
  125.     mov    es:[bx],cx    ; restore screen data
  126. skip_mov:    pop    es    ; restore regs
  127.     pop    dx
  128.     pop    cx
  129.     pop    bx
  130.     pop    ds
  131.     pop    ax
  132.     iret
  133.  
  134. pause:    assume    ds:bios_data    ; DS set in FIVE: routine
  135.     push    bx    ; save BX (for active page)
  136.     push    cx    ; save CX to use as scratch register
  137.     push    dx
  138.     push    es
  139.     cmp    v_mode,4    ; check for text mode
  140.     jb    calculate    ; continue if yes
  141.     cmp    v_mode,7    ; check for monochrome buffer
  142.     jne    no_p    ; skip "P" if graphics
  143.     mov    es,cs:mono_seg    ; point ES to segment at 0b000h
  144.     mov    bx,mono_point    ; offset into monochrome segment
  145.     jmp short skip_cga    ; skip color setup
  146.  
  147. no_p:    mov    graph_bit,1    ; set graphics mode flag
  148.     jmp short rejoin    ; rejoin main code
  149.  
  150. yes:    and    kb_flag_1,11110111b    ; turn ctrl-num-lock off
  151.     call    reset    ; reset keyboard
  152.     pop    ds
  153.     pop    ax
  154.     iret
  155.  
  156.     assume    ds:nothing
  157. five:    push    ds    ; save data segment
  158.     mov    ds,cs:bios_dat    ; point to keyboard data
  159.     assume    ds:bios_data
  160.     test    kb_flag_1,00001000b    ; check if Ctrl-NumLock on
  161.     jnz    yes    ; if yes, unpause
  162.     mov    al,kb_flag    ; get shift key status byte
  163.     test    al,00001100b    ; check for Alt or Ctrl pressed
  164.     jnz    quit    ; exit if so
  165.     and    al,00100011b    ; isolate NumLock and Shift bits
  166.     jz    pause    ; if zero (none pressed) then go!
  167.     cmp    al,00100000b
  168.     ja    pause    ; both NumLock & Shift must be pressed
  169.             ; if not, then end
  170.     assume    ds:nothing
  171. quit:    pop    ds    ; restore regs
  172.     pop    ax
  173.     jmp    kybd    ; goto BIOS
  174.  
  175.     assume    ds:nothing
  176. ; intercepts INT 9
  177. kybd_int:    push    ax    ; save reg
  178.     in    al,60h    ; get scan code
  179.     cmp    al,37h    ; scan code of PrtSc key
  180.     je    tog_chk    ; check for Alt pressed before toggling
  181.     test    toggle,1    ; check if enhanced keyboard enabled
  182.     jz    off    ; if not, skip enhanced processing
  183.     cmp    al,4ch    ; scan code of keypad "5" ?
  184.     je    five    ; if yes, check further
  185.     cmp    al,46h    ; check for Scroll-Lock (Break) key
  186.     je    break    ; if so, look for Ctrl-Shift
  187. off:    pop    ax    ;  if not, restore reg and
  188.     jmp    kybd    ; goto BIOS
  189.  
  190. ; check for right-shift-Ctrl
  191. break:    push    ds    ; save reg
  192.     mov    ds,bios_dat    ; set DS to bios data segment
  193.     assume    ds:bios_data
  194.     test    kb_flag_1,00001000b    ; check if ctrl-num-lock on
  195.     jnz    quit    ; goto BIOS if yes
  196.     test    kb_flag,00000001b    ; right shift key pressed?
  197.     jz    quit
  198.     test    kb_flag,00000100b    ; check for Ctrl key pressed
  199.     jz    quit
  200.     call    reset
  201.     mov    ax,4ccah    ; DOS EXIT function 4C
  202.             ;  ErrorLevel = 202
  203.     int    21h
  204.     pop    ds    ; restore regs
  205.     pop    ax
  206.     iret        ; return from key interrupt
  207.  
  208. tog_chk:    push    ds    ; save DS
  209.     mov    ds,bios_dat    ; point DS to bios data segment
  210.     assume    ds:bios_data
  211.     test    kb_flag_1,00001000b    ; check for Ctrl-NumLock pause on
  212.     jnz    quit    ; goto BIOS if yes
  213.     test    kb_flag,00000111b    ; check for Ctrl or L/R shift pressed
  214.     jnz    quit    ; don't toggle if yes - send key to bios
  215.     test    kb_flag,00001000b    ; check for Alt pressed
  216.     jz    quit    ; don't toggle if no - send key to bios
  217.     xor    toggle,1    ; toggle
  218.     jz    skip_beep    ; skip beep if toggled off
  219.     push    cx    ; save count reg for delay
  220. ; beep
  221. ; Step 1 -- prepare the timer to receive its divisor
  222.     mov     al,0b6h    ; timer mode register signal
  223.     out     67,al    ; output to timer control port
  224. ; Step 2 -- send the divisor count to the timer
  225. ;   Divisor = (1,190,000 / desired frequency)
  226.     mov     ax,595    ; divisor for 2000 Hz
  227.     out     66,al    ; output low-order byte of divisor
  228.     mov     al,ah    ;  high-order byte to output reg
  229.     out     66,al    ; output high-order byte of divisor
  230. ; Step 3 -- turn on the two bits which activate the speaker, and the
  231. ;           timer's control of the speaker
  232.     in      al,97    ; get current bit settings - port 97
  233.     mov     ah,al    ; save port 97 to turn sound off
  234.     or      al,03    ; turn on last two bits
  235.     out     97,al    ;  send back the new value
  236.  
  237.     mov     cx,8000h    ; approx 1/8 second
  238. delay:    loop    delay    ; sounding tone while counting
  239.     mov     al,ah    ; restore original port 97
  240.     out     97,al    ; stop tone
  241.     pop     cx    ; restore count reg
  242.  
  243. skip_beep:    call    reset    ; reset kybd and interrupt controller
  244.     pop    ds    ; restore regs
  245.     assume    ds:nothing
  246.     pop    ax
  247.     iret
  248.  
  249. reset    proc
  250.     in    al,61h    ; reset keyboard
  251.     mov    ah,al
  252.     or    al,80h
  253.     out    61h,al
  254.     mov    al,ah
  255.     out    61h,al
  256.     mov    al,20h    ; send end-of-interrupt signal
  257.     out    20h,al    ;  to interrupt controller
  258.     ret
  259. reset endp
  260.  
  261.     assume    ds:nothing
  262. cass_int:    cmp    ax,0ff00h    ; duplicate installation protection
  263.     je    duped    ; yes
  264.     jmp    cass    ; no, goto BIOS
  265. duped:    mov    ax,0abcdh
  266.     iret
  267.  
  268. nope:    jmp    kybd_io    ; goto BIOS
  269.  
  270.     assume    ds:nothing
  271. kybd_io_int:
  272.     test    toggle,1    ; check if enhanced keyboard enabled
  273.     jz    nope    ; if not, goto bios
  274.     test    ah,ah    ; check for AH = 0 (read key)
  275.     jnz    nope    ; if not, goto bios
  276.     pushf        ; simulate INT 16h
  277.     call    kybd_io
  278.     test    al,al    ; check for zero char code
  279.     jz    extend    ; continue if extended character
  280.     iret        ; return if not
  281.  
  282. extend:    cmp    ah,53h    ; skip predefined ext. functions
  283.     ja    ext    ; extended function routine(s)
  284. back:    iret        ; return if predefined
  285.  
  286. ; branch made if code greater than predefined (3-53h)
  287. ext:    cmp    ah,94    ; check for F21 (CTRL-F1)
  288.     jb    back    ; end if below
  289.     cmp    ah,103    ; CTRL-F10 - 67h
  290.     ja    next    ; goto next function
  291.  
  292.     push    dx    ; save DX
  293.     push    ax    ; save scan code
  294.  
  295.     mov    ah,2    ; read printer status
  296.     xor    dx,dx    ; zero DX - LPT1
  297.     int    17h    ; printer I/O
  298.     xor    ah,30h    ; check for OFFLINE
  299.     jz    offline    ; skip beep, prepare for exit
  300.  
  301.     pop    ax    ; retrieve scan code
  302.     push    bx
  303.     push    cx
  304.     sub    ah,94    ; bring scan code down to 0-9
  305. ; mult AH by 3
  306.     mov    bl,ah    ; save ah
  307.     shl    ah,1    ; mult by 2
  308.     add    bl,ah    ;  mult by 3
  309.     xor    bh,bh    ; zero BH
  310.     add    bx,offset PRNT_BUF    ; add mem loc to offset
  311.     mov    cx,3    ; 3-char printer output
  312.     xor    dx,dx    ; printer zero
  313.  
  314. loop1:    mov    al,3    ; full offset
  315.     sub    al,cl    ; sub count from full offset
  316.     xlat    cs:prnt_buf    ; get data in AL
  317.     cmp    al,0ffh    ; check for end-of-string
  318.     je    beep    ;  beep if EOS
  319.     xor    ah,ah    ; zero AH - print char
  320.     int    17h    ; BIOS printer I/O
  321.     loop    loop1    ; next char
  322.  
  323. beep:    cmp    cl,3    ; check for null string
  324.     je    p_end    ; skip beep if null
  325.     mov    ax,0007    ; printer output / BEL
  326.     int    17h    ; BIOS printer I/O
  327.     mov    ax,000dh    ; printer output / CR
  328.     int    17h    ; BIOS printer I/O
  329.  
  330. p_end:    pop    cx
  331.     pop    bx
  332.     sub    sp,2    ; fool next POP
  333. offline:    pop    ax
  334.     pop    dx
  335.     xor    ax,ax    ; zero AX (read_char)
  336. back3:    jmp    kybd_io_int    ; goto BIOS for next key
  337.  
  338. next:    cmp    ah,113    ; code > Alt-F10 ?
  339.     ja    next1    ; yes - goto 
  340.     je    cls    ; if code = Alt-F10 - execute CLS
  341.     cmp    ah,110    ; Alt-F7 < code < Alt-F10 ?
  342.     ja    back3    ; null processing
  343.  
  344.     push    bx    ; save base reg for XLAT
  345.     mov    al,ah    ; copy key code into AL for XLAT
  346.     sub    al,104    ; bring key-code to 0-6
  347.     mov    bx,offset datatbl    ; look-up table of video modes
  348.     xlat    cs:datatbl
  349.     xor    ah,ah    ; zero AH for INT 10h
  350.     int    10h
  351.     pop    bx    ; restore BX
  352.             ; AH already zero - read_key
  353.     jmp    kybd_io_int    ; goto bios
  354.  
  355. cls:    push    bx
  356.     push    cx
  357.     push    dx
  358.     push    ds
  359.     mov    ds,bios_dat
  360.     assume    ds:bios_data
  361.     mov    bh,7    ; attribute to use on blank window
  362.     xor    cx,cx    ; upper left corner = 0,0
  363.     mov    dh,24    ; bottom row to clear
  364.     mov    dl,v_width    ; bios video width byte
  365.     dec    dx    ; bios byte is either 40/80
  366.     mov    ax,600h    ; AH=6 (scroll up) AL=0 (blank window)
  367.     int    10h
  368.     mov    bh,v_page    ; get current video page
  369.     xor    dx,dx    ; upper left corner
  370.     mov    ah,2    ; position cursor
  371.     int    10h
  372.  
  373.     assume    ds:nothing
  374.     pop    ds    ; restore regs
  375.     pop    dx
  376.     pop    cx
  377.     pop    bx
  378.     xor    ax,ax    ; read_key
  379.     jmp    kybd_io_int    ; get next key
  380.  
  381. ; code greater than 110, ALT-F7
  382. next1:    cmp    ah,78h    ; ALT-1 (top row)
  383.     jb    end_ext    ; end routine
  384.     cmp    ah,127    ;     check code > ALT-8
  385.     ja    end_ext
  386.     push    bx    ; save regs
  387.     push    ax
  388.     mov    ah,15    ; read video state
  389.     int    10h
  390.     mov    vdata,al    ; save current mode
  391.     cmp    al,3    ; check for graphics modes
  392.     ja    back1    ; end if graphics
  393.     pop    ax    ; retrieve char code
  394.     mov    al,ah    ; char code into page result reg
  395.     sub    al,78h    ; bring char code down to page code
  396.     cmp    al,4    ; check for valid code 80 or 40
  397.     jb    skip1    ; change if valid unconditionally
  398.     cmp    vdata,1    ; check for 40 col display
  399.     ja    back2    ; end if 80 col
  400. skip1:    mov    ah,5    ; select active display page
  401.     int    10h
  402.     jmp short back2    ; finished
  403.  
  404. end_ext:            ; if key code not defined here,
  405.     iret        ;  give other routines a chance
  406.  
  407. back1:    add    sp,2    ; skip AX on stack
  408. back2:    pop    bx    ; restore BX
  409.     xor    ax,ax    ; zero AH - read key
  410.     jmp    kybd_io_int    ; get another char
  411.  
  412. ; control codes for Gemini (Epson compatible)
  413. prnt_buf    db    27,"V",1    ; slashed-zero      F1
  414.     db    27,"@",0ffh    ; power-on reset        F2
  415.     db    27,"B",1    ; 10 cpi (80 col)   F3
  416.     db    15,0ffh,00    ; 17 cpi (132 col)      F4
  417.     db    27,"E",0ffh    ; emphasized on     F5
  418.     db    27,"F",0ffh    ; emphasized off        F6
  419.     db    27,"S",0    ; superscript mode  F7
  420.     db    27,"S",1    ; subscript mode        F8
  421.     db    27,"U",1    ; unidirectional    F9
  422.     db    27,"U",0    ; bidirectional         F10
  423.  
  424. end_of_resident:
  425.  
  426. print_help:
  427.     xor    cx,cx    ; upper left row/column
  428.     mov    dx,184fh    ; lower right row/column
  429.     mov    bh,7    ; attribute for blank region
  430.     mov    ax,600h    ; scroll up/blank entire window
  431.     int    10h
  432.     mov    ah,15    ; get video data
  433.     int    10h    ; active page in BH
  434.     xor    dx,dx    ; upper left row/column
  435.     mov    ah,2    ; set cursor position
  436.     int    10h
  437.     mov    dx,offset help_text    ; get address of help screen
  438.     mov    ah,9    ; DOS print string
  439.     int    21h
  440.     mov    ax,0ff00h    ; check (again) for duplicate installation
  441.     int    15h
  442.     cmp    ax,0abcdh
  443.     je    skip_prnt    ; if yes, skip printing install instructions
  444.     mov    dx,offset not_yet    ; message - type newinit install
  445.     mov    ah,9    ; DOS print string
  446.     int    21h
  447. skip_prnt:    int    20h    ; terminate
  448.  
  449. init_vectors:
  450.     mov    ds,bios_dat
  451.     assume    ds:bios_data
  452.     mov    al,kb_flag    ; get keyboard status byte
  453.     xor    al,00000011b    ; check if both shift keys pressed
  454.     jnz    continue    ; if not, continue with installation
  455.     mov    ax,4cabh    ; DOS EXIT function, ERRORLEVEL = X'AB'
  456.     int    21h
  457.  
  458. continue:    mov    ax,cs    ; set data segment to code segment
  459.     mov    ds,ax
  460.     assume    ds:cseg
  461.     mov    code_seg,ax    ; save code segment for resident routine
  462.     xor    cx,cx    ; zero CX
  463.     mov    cl,parm_cnt    ; get number of parameters
  464.     jcxz    print_help    ; print help screen
  465.     mov    si,offset parm_data    ; start of parameter line
  466.     cld        ; clear DF to increment SI
  467. loop2:    lods    parm_data    ; get byte from parm_data
  468.     cmp    al,"Z"+1    ; check if lower case
  469.     jb    lp2
  470.     sub    al,"a"-"A"    ; convert to lower case
  471.     mov    [si-1],al    ; put back into param line    
  472. lp2:    loop    loop2    ; get next char
  473.  
  474. check:    mov    di,offset parm_data
  475.     mov    al,"I"    ; search for "I"
  476.     mov    cl,parm_cnt    ; number of characters to search
  477.     repne scasb    ; scan parameter line
  478.     jne    print_help    ; print help screen if not found
  479.     mov    si,1 + offset key    ; "INSTALL" but past the "I"
  480.     assume    es:cseg
  481.     repne cmps parm_data,key    ; check for key in parameter line
  482.     jne    print_help    ; if not found, print help screen
  483.     mov    ax,0ff00h    ; if found, check for prev install
  484.     int    15h    ; cassette (snicker!) interrupt
  485.     cmp    ax,0abcdh    ; duplicate installation code
  486.     jne    install    ; full speed ahead
  487.     mov    dx,offset already    ; error message
  488.     mov    ah,9    ; DOS print string
  489.     int    21h
  490.     int    20h    ; bye-bye
  491.  
  492. install:    mov    ax,2    ; AH=0 - set video mode
  493.             ; AL=2 - 80 col mono
  494.     int    10h
  495.     mov    ax,3505h    ; get int vector for INT 5
  496.     int    21h
  497.     mov    word ptr prtsc,bx    ; save routine offset
  498.     mov    word ptr prtsc[2],es    ; save routine segment
  499.     mov    dx,offset prtsc_int    ; offset of new routine
  500.             ; DS = CS above
  501.     mov    ah,25h    ; set int vector for INT 5
  502.     int    21h
  503.  
  504.     mov    ax,3509h    ; get int vector for INT 9
  505.     int    21h
  506.     mov    word ptr kybd,bx    ; save offset
  507.     mov    word ptr kybd[2],es    ; save segment
  508.     mov    dx,offset kybd_int    ; offset of user routine
  509.     mov    ah,25h    ; set int vector
  510.     int    21h
  511.  
  512.     mov    ax,3515h    ; get int vector for INT 15h
  513.     int    21h
  514.     mov    word ptr cass,bx    ; save offset
  515.     mov    word ptr cass[2],es    ; save segment
  516.     mov    dx,offset cass_int    ; offset of user routine
  517.     mov    ah,25h    ; set int vector
  518.     int    21h
  519.  
  520.     mov    ax,3516h    ; get int vector for INT 16h
  521.     int    21h
  522.     mov    word ptr kybd_io,bx    ; save offset
  523.     mov    word ptr kybd_io[2],es    ; save segment
  524.     mov dx, offset kybd_io_int    ; offset of user routine
  525.     mov    ah,25h    ; set int vector
  526.     int    21h
  527.  
  528.     mov    dx,offset installed    ; completed message
  529.     mov    ah,9    ; DOS print string
  530.     int    21h
  531.     mov    dx,offset end_of_resident
  532.     int    27h    ; terminate, remain resident
  533.  
  534. key    db    "INSTALL"    ; installation text key
  535.  
  536. already    db    13,10,10,9,9
  537.     db    "This utility already resident.",13,7,10,10,"$"
  538.  
  539. installed    db    9,9,"NEWINIT is up and running.",10,10,"$"
  540.  
  541. help_text:    db    "This resident program modifies certain key combinations:",13,10
  542.  db "1) PrtSc will only work if the left shift key is used.",13,10
  543.  db "2) Ctrl-Right-Shift-Break forces a DOS function call X'4C' (EXIT) which will"
  544.     db    13,10
  545.  db "   exit the current program.  This avoids much of the need for Ctrl-Alt-Del."
  546.     db    13,10
  547.  db "   If exit is forced in this manner, errorlevel is set to X'CA' (202).",13,10
  548.  db "3) Alt-1 thru Alt-8 (top row) will VIEW that display page (I/O not reliable)."
  549.     db    13,10
  550.  db "4) Alt-F1 thru Alt-F7 change the video mode.",13,10
  551.  db "      F1 = 80 col mono (at startup)    F2 = 80 col color",13,10
  552.  db "      F3 = 40 col mono                 F4 = 40 col color",13,10
  553.  db "      F5 = med res mono graphics       F6 = medium res color graphics",13,10
  554.  db "      F7 = high res graphics           F10 = clears the current display page"
  555.  db 13,10
  556.  db "5) Ctrl-F1 thru Ctrl-F10 send (Epson) control codes to the printer.",13,10
  557.  db "      F1 = slashed-zero                F2 = power-on reset",13,10
  558.  db "      F3 = 10 cpi (80 col)             F4 = 17 cpi (132 col)",13,10
  559.  db "      F5 = emphasized on               F6 = emphasized off",13,10
  560.  db "      F7 = superscript mode            F8 = subscript mode",13,10
  561.  db "      F9 = unidirectional              F10 = bidirectional",13,10
  562.  db "6) The keypad '5' key is a toggle pause key.  While on, the letter P is"
  563.     db    13,10
  564.  db "   displayed, flashing and highlighted, in the lower right corner.",13,10
  565.  db "7) Alt-PrtSc will toggle the enhanced keyboard on/off.  A beep signals on."
  566.  db 13,10,10,"$"
  567.  
  568. not_yet db 9,"To make NEWINIT resident, type:  newinit install",13,10,10,"$"
  569.  
  570. cseg ends
  571.     end    begin
  572.  
  573. move alt-fn and ctrl-fn to int-9
  574.